package com.tang.hashMap_hashSet;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

/**
 * @author tmh
 * @date 2024/3/24 15:51
 * @description HashMap和HashSet有什么区别
 */
public class HashMapAndHashSetTest {
    public static void main(String[] args) {
        Map<String, String> map = new HashMap<>();
        map.put("A", "Apple");
        map.put("B", "Ball");
        map.put("A", "Cat");
        map.forEach((k, v) -> System.out.println(k + " " + v));

        Set<String> set=new HashSet<>();
        set.add("A");
        set.add("A");
        set.forEach(System.out::println);
    }
}
